import { createRouter, createWebHashHistory } from 'vue-router'


import Login from '@/views/login/Login.vue'
import AlipayLogin from '@/views/login/AlipayLogin.vue'
import WechatLogin from '@/views/login/WechatLogin.vue'
import QQLogin from '@/views/login/QQLogin.vue'
import Jump from '@/views/login/Jump.vue'
import Order from '@/views/order/Order.vue'
import MyOrder from '@/views/order/MyOrder.vue'
import Register from '@/views/register/Register.vue'
import Concern from '@/views/find/Concern.vue'
import RestaurantCard from '@/views/restaurantCard/restaurantCard.vue'
import Usercomments from '@/views/restaurantCard/Usercomments.vue'
import Discount from '@/views/restaurantCard/Discount.vue'
import Merchant from '@/views/restaurantCard/Merchant.vue'
import Home from '@/views/home/Home.vue'
import Search from '@/views/home/search/Search.vue'
import Package from '@/views/home/package/package.vue'
import PackageOne from '@/views/home/package/packageOne.vue'
import PackageTwo from '@/views/home/package/packageTwo.vue'
import PackageFour from '@/views/home/package/PackageFour.vue'
import Snapped1 from '@/views/home/snapped/Snapped1.vue'
import Snapped2 from '@/views/home/snapped/Snapped2.vue'
import Snapped3 from '@/views/home/snapped/Snapped3.vue'
import Find from '@/views/find/Find.vue'
import Sheet from '@/views/find/Sheet.vue'
import NewGoods from '@/views/find/NewGoods.vue'
import Follow from '@/views/find/Follow.vue'
import Boutique from '@/views/find/Boutique.vue'

const routes = [
    { path: '/login', name: 'login', component: Login },

    {
 
        path: '/', redirect: 'title', children: [
 
            { path: 'my', name: "my", component: () => import('@/views/zb_my/index.vue') },
            { path: 'nearby', name: "nearby", component: () => import('@/views/zb_nearby/Nearby/index.vue') },
            { path: 'title', name: "title", component: () => import('@/views/zb_title/index.vue') },
            { path: 'NearbySearch', name: "NearbySearch", component: () => import('@/views/zb_nearby/Search/index.vue') },
        ]
    },
    { path: '/register', name: 'register', component: Register },
    { path: '/alipayLogin', name: 'alipayLogin', component: AlipayLogin },
    { path: '/wechatLogin', name: 'wechatLogin', component: WechatLogin },
    { path: '/qqLogin', name: 'qqLogin', component: QQLogin },
    { path: '/jump', name: 'jump', component: Jump },
    { path: '/order', name: 'order', component: Order },
    { path: '/myOrder', name: 'myOrder', component: MyOrder },
    { path: '/home', name: 'home', component: Home },

    {
        path: '/restaurantCard', name: "restaurantCard", component: RestaurantCard, redirect: { path: 'discount' },
        children: [

            { path: '/usercomments', name: "usercomments", component: Usercomments },
            { path: '/discount', name: 'discount', component: Discount },
            { path: '/merchant', name: 'merchant', component: Merchant },
        ]
    },
    { path: '/search', name: 'search', component: Search },

    {
        path: '/package', name: 'package', component: Package, redirect: { path: '/package/packageOne' },
        children: [
            { path: 'packageOne', name: 'package1', component: PackageOne },
            { path: 'packageTwo', name: 'package2', component: PackageTwo },
            { path: 'PackageFour', name: 'package4', component: PackageFour }
        ]
    },
    {
        path: '/snapped1', name: 'snapped1', component: Snapped1,
    },
    { path: '/snapped2', name: 'snapped2', component: Snapped2 },
    { path: '/snapped3', name: 'snapped3', component: Snapped3 },
    {
        path: '/find',
        name: 'find',
        component: Find,
        redirect: {
            path: '/boutique'
        },
        children: [{
            path: '/sheet',
            name: 'sheet',
            component: Sheet
        },
        {
            path: '/newgoods',
            name: 'newgoods',
            component: NewGoods
        },
        {
            path: '/follow',
            name: 'follow',
            component: Follow
        },
        {
            path: '/boutique',
            name: 'boutique',
            component: Boutique
        },
        {
            path: '/concern',
            name: 'concern',
            component: Concern
        }
        ]
    }
]


const router = createRouter({
    routes,
    history: createWebHashHistory()
})

export default router


